package com.woniu.product.client;


import com.woniu.product.client.param.AddCategoryParam;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "categoryManageClient",name="product")
public interface CategoryManageClient {
    /**
     * 新增类别
     * @param addCategoryParam
     * @return
     */
    @PostMapping ("addCategory")
    public Result addCategory(@RequestBody AddCategoryParam addCategoryParam);

    /**
     * 删除类别
     * @param categoryId
     * @return
     */
    @GetMapping("delCategory")
    //TODO 不确定删除的逻辑
    public Result delCategory(@RequestParam("categoryId") Integer categoryId );

}
